<%@ page language="java" contentType="text/html; charset=utf-8" import="com.bjsxt.shopping.user.*,com.bjsxt.shopping.product.Translatorsanalysis,com.bjsxt.shopping.product.*,java.text.DecimalFormat"
    pageEncoding="utf-8"%>
<%@ page import="java.util.*"%>

<%
	final int PAGE_SIZE = 8;
	int pageNo = 1;
	String strPageNo = request.getParameter("curPageNo");
	if (strPageNo != null && !strPageNo.trim().equals("")) {
		try {
			pageNo = Integer.parseInt(strPageNo);
		} catch (NumberFormatException e) {
			pageNo = 1;
		}
	}
	if (pageNo <= 0)
		pageNo = 1;
	// int categoryId = Integer.parseInt(request.getParameter("categoryId"));
			
	int categoryId =1;
			
	List<Translatorsanalysis> products = new ArrayList<Translatorsanalysis>();
	int totalRecords = ProductMgr.getInstance().findtranstar(products, pageNo,
			PAGE_SIZE, categoryId);

	int totalPages = (totalRecords + PAGE_SIZE - 1) / PAGE_SIZE;

	if (pageNo > totalPages)
		pageNo = totalPages;
%>

<html>
	<head>

		<meta http-equiv="Content-Language" content="zh-cn">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>--译者管理</title>

		<link href="images/new.css" rel="stylesheet" type="text/css">
		<script language="javascript1.2">
function js_callpage(htmlurl)
{
	var newwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,top=2,width=360,height=470');
	return false;
}
function js_callpage1(htmlurl)
{
	var newwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=2,width=100,height=100');
	return false;
}
function to_page(forword)
{
	if(forword=="1"){
		register.curPageNo.value=1;
	}

	if(forword=="pre"){
		var curPageId = parseInt(document.getElementById("curPageNo").value);
		curPageId=curPageId-1;
		
		if(curPageId>=1){
			register.curPageNo.value=curPageId;
		}else{
			alert('已是第一页了！');	
			return ;
		}		
	}
	
	if(forword=="next"){
		var curPageId = parseInt(document.getElementById("curPageNo").value);
		curPageId=curPageId+1;
		
		var allPages = parseInt(document.getElementById("allPages").value);
		if(curPageId<=allPages){
			register.curPageNo.value=curPageId;
		}else{
			alert('已是最后一页了！');	
			return ;
		}
	}
}
</script>




	</head>
	<body>
	<form  method="post" name="register"  action="" onSubmit="this.submit.disabled=true;">	
		<table align="center" border="0" cellpadding="0" cellspacing="0"
			width="980">
			<tbody>


				<tr>
					<td bgcolor="#dadce8" height="1">
						<img src="images/line.gif" height="1" width="1">
					</td>
				</tr>

				<tr>
					<td>
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
							<tbody>
								<tr>
									<td bgcolor="#e5e5f0" valign="top" width="190">
										<table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tbody>
												<tr>
													
												</tr>
												<tr>
													<td>
														<img src="images/gg11.jpg" height="60" width="180">
													</td>
												</tr>


										</table>
									</td>
									<td width="10">
									</td>
									<td valign="top" colspan="1">
										<table style="border-collapse: collapse;" border="1"
											bordercolor="#111111" cellpadding="0" cellspacing="0"
											height="417" width="100%">
											<tbody>


												<tr>
													<td height="119" colspan="6">
														<table style="border-collapse: collapse;" border="0"
															bordercolor="#111111" cellpadding="0" cellspacing="0"
															width="100%">
															<tbody>
																								<br>
																								<tr>
																									<td align="right">
																										<a
																											href=""
																											class="mingcheng1"> <img src="/images/refresh.gif"></img> </a>
																											&nbsp;&nbsp;
																											<a href="AdminIndex1.jsp"><font style="font-weight:bold;color:blue;TEXT-DECORATION: underline; ">返回</font></a>&nbsp;&nbsp;&nbsp;&nbsp; 
																									</td>
																								</tr>
																								<tr>
																									<td>
																										&nbsp;
																										<img src="images/m_33.gif" height="10"
																											width="10">
																										&nbsp;
																										<strong><a
																											href="">译者管理</a>
																										</strong> &nbsp;
																									</td>
																								</tr>
																								
																								<td align="left">
																										全部
																										<b><%=totalRecords%> </b>条订单,共
																										<b><%=totalPages%> </b>页,当前第
																										<b><%=pageNo%> </b>页&nbsp;&nbsp;
																										<input type="submit" value="上一页" onclick="to_page('pre')" />
																										<input type="submit" value="下一页" onclick="to_page('next')"/>
																										<input id="curPageNo" name="curPageNo" value=<%=pageNo%> type="hidden">
																										<input id="allPages" name="allPages" value=<%=totalPages%> type="hidden">
																									</td>


																							</tbody>
																						</table>
																					</td>

																				</tr>

																			

																				<tr>
																					<td width="13%" align="center">译者</td>
																					<td width="13%" align="center">联系方式</td>
																					<td width="13%" align="center">翻译人员级别</td>
																					<td width="13%" align="center">翻译累计数量</td>
																					<td width="13%" align="center">审核通过数量</td>
																					<td width="13%" align="center">审核通过率</td>
																				
																				</tr>
																				<%
																						if( products.size()==0) {
																				%>
																				<tr>
																					<td align="center" colspan="5">没有该条件的订单！</td>
																				
																				</tr>
																				<%
																						}
																				%>																				


																				<%
																						for (int i = 0; i < products.size(); i++) {
																						Translatorsanalysis p = products.get(i);
																				%>																			

																				
																				<tr>
																				 	
																				 	<td align="center"><%=p.getLoginname()%></td>
																				 	<td><%=p.getPhone()%></td>
																				 	<td align="center"><%=p.getTranslatorLevel()%></td>
																				 	<td align="center"><%=p.getTranslates()%></td>
																				 	<%
																						
																						DecimalFormat df = new DecimalFormat ("#.##");
																						int tt1;
																						Double tt2=p.getPasstimes()+0.0;
																						Double tt3=p.getTranslates()+0.0;
																					%>
																				 	<td align="center"><%=p.getPasstimes()%></td>
																				 	<%
																				 		if(tt3==0){
																				 	%>
																				 	<td align="center">0.00%</td>
																				 	<%
																				 		}
																				 	%>
																				 	<%
																				 		if(tt3!=0){
																				 		//String aa=df.format((tt2/tt3)*100);
																				 		
																				 	%>
																				 	<td align="center"><%=df.format((tt2/tt3)*100)%>%</td>
																				 	<%
																				 		}
																				 	%>
																				 	
																				 
																				</tr>
																				
																				<%
																				} // end for
																				%>

																			
																		</table>
																	</td>
																</tr>

															</tbody>
														</table>
													</td>
												</tr>
												<tr>
													<td height="30">
													</td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<td width="100%">
						<!--底部INC--><br>
					</td>
				</tr>
			</tbody>
		</table>
		</form>
	</body>
</html>
